package com.ruoyi.web.controller.net;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.net.domain.ElementQosActionShape;
import com.ruoyi.net.service.IElementQosActionShapeService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 网元-QOS配置-流行为-流量整形Controller
 * 
 * @author net
 * @date 2024-11-17
 */
@Api(tags = "网元-QOS配置-流行为-流量整形")
@RestController
@RequestMapping("/element/qos/action/shape")
public class ElementQosActionShapeController extends BaseController
{
    @Autowired
    private IElementQosActionShapeService elementQosActionShapeService;

    /**
     * 查询网元-QOS配置-流行为-流量整形列表
     */
    @ApiOperation(value = "查询网元-QOS配置-流行为-流量整形列表", httpMethod = "GET")
    //    @PreAuthorize("@ss.hasPermi('system:shape:list')")
    @GetMapping("/list")
    public TableDataInfo list(ElementQosActionShape elementQosActionShape)
    {
        startPage();
        List<ElementQosActionShape> list = elementQosActionShapeService.selectElementQosActionShapeList(elementQosActionShape);
        return getDataTable(list);
    }

    /**
     * 导出网元-QOS配置-流行为-流量整形列表
     */
    @ApiOperation(value = "导出网元-QOS配置-流行为-流量整形列表", httpMethod = "POST")
    //    @PreAuthorize("@ss.hasPermi('system:shape:export')")
    @Log(title = "网元-QOS配置-流行为-流量整形", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ElementQosActionShape elementQosActionShape)
    {
        List<ElementQosActionShape> list = elementQosActionShapeService.selectElementQosActionShapeList(elementQosActionShape);
        ExcelUtil<ElementQosActionShape> util = new ExcelUtil<ElementQosActionShape>(ElementQosActionShape.class);
        util.exportExcel(response, list, "网元-QOS配置-流行为-流量整形数据");
    }

    /**
     * 获取网元-QOS配置-流行为-流量整形详细信息
     */
    @ApiOperation(value = "获取网元-QOS配置-流行为-流量整形详细信息", httpMethod = "GET")
    //    @PreAuthorize("@ss.hasPermi('system:shape:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(elementQosActionShapeService.selectElementQosActionShapeById(id));
    }

    /**
     * 新增网元-QOS配置-流行为-流量整形
     */
    @ApiOperation(value = "新增网元-QOS配置-流行为-流量整形", httpMethod = "POST")
    //    @PreAuthorize("@ss.hasPermi('system:shape:add')")
    @Log(title = "网元-QOS配置-流行为-流量整形", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ElementQosActionShape elementQosActionShape)
    {
        return toAjax(elementQosActionShapeService.insertElementQosActionShape(elementQosActionShape));
    }

    /**
     * 修改网元-QOS配置-流行为-流量整形
     */
    @ApiOperation(value = "修改网元-QOS配置-流行为-流量整形", httpMethod = "PUT")
    //    @PreAuthorize("@ss.hasPermi('system:shape:edit')")
    @Log(title = "网元-QOS配置-流行为-流量整形", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ElementQosActionShape elementQosActionShape)
    {
        return toAjax(elementQosActionShapeService.updateElementQosActionShape(elementQosActionShape));
    }

    /**
     * 删除网元-QOS配置-流行为-流量整形
     */
    @ApiOperation(value = "删除网元-QOS配置-流行为-流量整形", httpMethod = "DELETE")
    //    @PreAuthorize("@ss.hasPermi('system:shape:remove')")
    @Log(title = "网元-QOS配置-流行为-流量整形", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(elementQosActionShapeService.deleteElementQosActionShapeByIds(ids));
    }
}
